//
//  KHHSearchTitleCollectionReusableView.m
//  Travel
//
//  Created by dllo on 15/12/2.
//  Copyright © 2015年 doll. All rights reserved.
//

#import "KHHSearchTitleCollectionReusableView.h"

@interface KHHSearchTitleCollectionReusableView ()

@property (nonatomic, retain)UILabel *titleLabel;
@end


@implementation KHHSearchTitleCollectionReusableView


#pragma mark - 初始化
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.titleLabel = [[UILabel alloc]init];
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.titleLabel];
        self.titleLabel.textColor = [UIColor colorWithRed:0.23 green:0.67 blue:0.73 alpha:1];
        self.titleLabel.font = [UIFont fontWithName:@"Arial-Bold" size:16];
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
//    //夜间模式
//    if ([[NSUserDefaults standardUserDefaults]boolForKey:@"isNight"]) {
//        self.backgroundColor = [UIColor colorWithRed:0.28 green:0.28 blue:0.28 alpha:1];
//    }else
//    {
//        self.backgroundColor = [UIColor colorWithRed:0.98 green:0.97 blue:0.93 alpha:1];
//    }
    //标题
    self.titleLabel.frame = CGRectMake(0, 0, layoutAttributes.size.width, layoutAttributes.size.height);
}

- (void)setModel:(KHHRecommendModel *)model
{
    _model = model;
    self.titleLabel.text = model.title;
}

@end
